home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / human interface toolbox / live scroll / scrollbars.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  1.9 KB  |  87 lines

  1. /*
  2.     File:        ScrollBars.h
  3.  
  4.     Contains:    Header for scroll bars live scrolling implementation.
  5.  
  6.     Written by: Chris White    
  7.  
  8.     Copyright:    Copyright © 1996-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 8/6/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23.  
  24.  
  25. #ifndef __SCROLLBARS__
  26. #define __SCROLLBARS__
  27.  
  28.  
  29.  
  30. enum
  31. {
  32.     // Misc scroll bar constants
  33.  
  34.     kScrollBarWidth = 16,
  35.     kScrollBarWidthAdjust = kScrollBarWidth - 1,
  36.     
  37.     kScrollArrowWidth = 16,
  38.     kScrollThumbWidth = 16,
  39.     kTotalWidthAdjust = (kScrollArrowWidth * 2) + kScrollThumbWidth,
  40.     
  41.     kPageOverlap = 10,
  42.     kThumbTrackWidthSlop = 25,
  43.     kThumbTrackLengthSlop = 113
  44.  
  45. };
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. typedef    pascal void (*IndicatorActionProc)(void);
  53.  
  54. #if GENERATINGCFM
  55. typedef UniversalProcPtr IndicatorActionUPP;
  56. #else
  57. typedef IndicatorActionProc IndicatorActionUPP;
  58. #endif
  59.  
  60. enum
  61. {
  62.     uppIndicatorActionProcInfo = kPascalStackBased
  63. };
  64.  
  65. #if GENERATINGCFM
  66. #define NewIndicatorActionProc(userRoutine)        \
  67.         (IndicatorActionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppIndicatorActionProcInfo, GetCurrentArchitecture())
  68. #else
  69. #define NewIndicatorActionProc(userRoutine)        \
  70.         ((IndicatorActionUPP) (userRoutine))
  71. #endif
  72.  
  73. #if GENERATINGCFM
  74. #define CallIndicatorActionProc(userRoutine)    \
  75.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppIndicatorActionProcInfo)
  76. #else
  77. #define CallIndicatorActionProc(userRoutine)    \
  78.         (*(userRoutine))()
  79. #endif
  80.  
  81.  
  82.  
  83.  
  84.  
  85. #endif    // __SCROLLBARS__
  86.  
  87.